package linkedlist;

import Exceptions.BadDataExcepiton;
import Exceptions.EmptyLinkedListException;
import Exceptions.OutOfLinkedListException;

public class Demo {
	public static void main(String[] args) {
		LinkedList myList = new LinkedList();
		try {
			myList.add("First element");
			myList.add("Second element");
			myList.add("Third element");
		} catch (BadDataExcepiton e) {
			System.out.println("BadData!");
		} catch (EmptyLinkedListException e) {
			System.out.println("bla");
		}

		System.out.println(myList.getSize());
		try {
			for (int i = 0; i < myList.getSize(); i++) {
				System.out.println(myList.get(i).toString());
				System.out.println("blasila");
			}
		} catch (OutOfLinkedListException | EmptyLinkedListException e) {
			e.printStackTrace();
		}

	}
}
